import os
os.environ["DASHSCOPE_API_KEY"] = 'sk-965dc39b016c49ecbe29de180f4db2b6'
from langchain_community.chat_models.tongyi import ChatTongyi
from langchain_core.messages import HumanMessage

chatLLM = ChatTongyi(
    streaming=True,
)
res = chatLLM.stream([HumanMessage(content="写一首七言绝句")], streaming=True)
print(res)
